package com.csun.cmny.provider.model.enums.follow;

import com.csun.cmny.provider.model.enums.csunsleep.DmcCsunSleepBindTypeEnum;

import java.util.Arrays;
import java.util.List;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-02-15 19:29
 * @Description: the enum follow boxygen status enum
 */
public enum FollowBoxygenStatusEnum {

    /**
     * 血氧偏低
     */
    BOXYGEN_LOW("血氧偏低", "建议就医诊断", 0, 95),

    /**
     * 血氧正常
     */
    BOXYGEN_NORMAL("血氧正常", "适量运动,营养均衡,继续保持", 95, 98),

    /**
     * 血氧偏高
     */
    BOXYGEN_HIGH("血氧偏高", "建议就医诊断", 98, 100),;

    String status;

    String suggest;

    Integer boxygenLow;

    Integer boxygenHigh;

    FollowBoxygenStatusEnum(String status, String suggest, Integer boxygenLow, Integer boxygenHigh) {
        this.status = status;
        this.suggest = suggest;
        this.boxygenLow = boxygenLow;
        this.boxygenHigh = boxygenHigh;
    }

    /**
     * Gets status.
     *
     * @return  the status
     */
    public String getStatus() {
        return status;
    }

    /**
     * Gets suggest.
     *
     * @return  the suggest
     */
    public String getSuggest() {
        return suggest;
    }

    /**
     * 获取状态
     */
    public static String getStatus(Integer boxygen) {

        for (FollowBoxygenStatusEnum ele : FollowBoxygenStatusEnum.values()) {
            if (boxygen.compareTo(ele.boxygenLow) >=0 && boxygen.compareTo(ele.boxygenHigh) < 0) {
                return ele.getStatus();
            }
        }
        return null;
    }

    /**
     * 获取建议
     */
    public static String getSuggest(Integer boxygen) {

        for (FollowBoxygenStatusEnum ele : FollowBoxygenStatusEnum.values()) {
            if (boxygen.compareTo(ele.boxygenLow) >=0 && boxygen.compareTo(ele.boxygenHigh) < 0) {
                return ele.getSuggest();
            }
        }
        return null;
    }

    /**
     * 获取List集合
     *
     * @return List list
     */
    public static List<FollowBoxygenStatusEnum> getList() {
        return Arrays.asList(FollowBoxygenStatusEnum.values());
    }

}
